package com.ctgu.tengyun.bean.convert;

import com.ctgu.tengyun.bean.response.CustomerListResponse;
import com.ctgu.tengyun.domain.CustomerInfo;

import java.util.List;

/**
 * Created by liaoweizhi on 2019/8/8.
 */
public class CustomerConvert {

    public static CustomerListResponse toCustomerListResponse(Integer totalCount,
                                                               Integer pageSize,
                                                               List<CustomerInfo> customerInfoList){
        CustomerListResponse response = new CustomerListResponse();

        response.setTotalCount(totalCount);
        response.setTotalPage((int) Math.ceil(totalCount / (double) pageSize));
        response.setCustomerList(customerInfoList);

        return response;
    }
}
